package com.wanchuang.qhbb.adapter;

import android.content.Context;
import android.graphics.Color;
import android.util.Log;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.wanchuang.qhbb.R;
import com.wanchuang.qhbb.help.GlideHelper;
import com.wanchuang.qhbb.proto.AgentPolicy;
import com.wanchuang.qhbb.proto.Mystock;
import com.ruffian.library.widget.RTextView;

import java.util.List;

/**
 * 文件名 : ProgressAdapter
 * 创建者 : MangoWang
 * 创建日期 : 2019/11/25 11:50
 * 微信 : MangoWaWang
 * 邮箱 : 763482205@qq.com
 * 描述 : TODO
 */

public class AllowApplyAdapter extends BaseQuickAdapter<AgentPolicy.modify_policy_log, BaseViewHolder> implements LoadMoreModule {

    private String userID;

    public AllowApplyAdapter(Context context, List<AgentPolicy.modify_policy_log> dataList, String useId) {
        super(R.layout.item_allow_apply, dataList);
        userID = useId;
    }

    @Override
    protected void convert(BaseViewHolder helper, AgentPolicy.modify_policy_log item) {
        GlideHelper.INSTANCE.loadImage(helper.getView(R.id.iv_image), item.getLogo());
        String detailmsg = item.getActionMsg();
        if (detailmsg.contains("库"))
            helper.setBackgroundResource(R.id.iv_tubiao, R.mipmap.tubiaotwo);
        if (detailmsg.contains("政策"))
            helper.setBackgroundResource(R.id.iv_tubiao, R.mipmap.tubiaoone);
        if (detailmsg.contains("提现"))
            helper.setBackgroundResource(R.id.iv_tubiao, R.mipmap.tubiaothree);
        helper.setText(R.id.tv_titless, detailmsg);
        String msg = item.getTitle();
        helper.setText(R.id.tv_name, msg);
        helper.setText(R.id.tv_time, item.getCreateTime())
                .setText(R.id.tv_word, item.getWord())
                .setTextColor(R.id.tv_word, Color.parseColor(item.getColour()));
    }
}